﻿using DotSpatial.Controls;
using DotSpatial.Data;
using DotSpatial.Symbology;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace KASEM
{
    public partial class Form2 : Form
    {
        FeatureLayer FeLyr; //= MainMap.Layers[0] as FeatureLayer;
        ISelection selFe; //= FeLyr.Selection;
        FeatureSet Fe;// = selFe.ToFeatureSet();
        Map mainMap;
        public Map MainMap
        {
            get { return mainMap; }
            set { mainMap = value; }
        }
        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            FeLyr = MainMap.Layers[0] as FeatureLayer;
            selFe = FeLyr.Selection;
            Fe =  selFe.ToFeatureSet(); 
            dataGridView1.DataSource = Fe.DataTable;
            label1.Text = "Number of selected shapes are: "+Fe.NumRows().ToString();   
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int row = e.RowIndex;
            IFeature fe = Fe.GetFeature(row); 

        }

    }
}
